package com.unionfetch.content_home.api

import com.unionfetch.content_home.bean.AccountCount
import com.unionfetch.content_home.bean.AccountLeverInfo
import com.unionfetch.content_home.bean.DemoAccountInfo
import com.unionfetch.content_home.bean.LiveAccountInfo
import com.unionftech.common.bean.ResponseResult
import okhttp3.RequestBody
import retrofit2.http.Body
import retrofit2.http.GET
import retrofit2.http.Header
import retrofit2.http.POST
import retrofit2.http.PUT
import retrofit2.http.Query

interface AccountApi {
    /**
     * 返回用户真实账户列表
     */
    @GET("trade/user/realAccount")
    suspend fun getUserLiveAccountList(@Header("Authorization") token: String): ResponseResult<LiveAccountInfo>

    /**
     * 返回用户虚拟账户列表
     */
    @GET("trade/user/virtualAccount")
    suspend fun getUserDemoAccountList(@Header("Authorization") token: String): ResponseResult<DemoAccountInfo>


    /**
     * 新增虚拟账户
     */
    @POST("trade/user/create")
    suspend fun createDemoAccount(
        @Header("Authorization") token: String, @Body body: RequestBody
    ): ResponseResult<Any?>

    /**
     * 新增真实账户
     */
    @POST("trade/user/add/same/account")
    suspend fun createLiveAccount(
        @Header("Authorization") token: String, @Body body: RequestBody
    ): ResponseResult<Any?>

    /**
     * 修改杠杆
     */
    @PUT("trade/user/leverage/leverage")
    suspend fun modifyLeverage(
        @Header("Authorization") token: String, @Body body: RequestBody
    ): ResponseResult<Any?>

    /**
     * 修改杠杆
     */
    @POST("trade/user/changeLeverage")
    suspend fun modifyDemoLeverage(
        @Header("Authorization") token: String, @Body body: RequestBody
    ): ResponseResult<Any?>

    /**
     * 查询当前账号的杠杆信息
     */
    @GET("trade/user/leverage/leverage")
    suspend fun queryLeverage(
        @Header("Authorization") token: String, @Query("account") tradeNo: String
    ): ResponseResult<AccountLeverInfo>


    /**
     * 获取真实账户审核中的个数的接口
     */
    @GET("trade/user/getreal/audit/count")
    suspend fun queryAccountCount(
        @Header("Authorization") token: String,
        @Query("status") status: Int,
        @Query("userId") userId: String
    ): ResponseResult<AccountCount>

}